<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>

<div class="form_table1" id="utb" style="padding:5px;background:#efefef;">
	审核金额：<input type="text" autocomplete="off"  class="easyui-numberbox" precision="2" name="ucost" id="ucost"/>
	审核等级:<select  style="width:130px;" name="ucolumnLev" id="ucolumnLev"  name="ucolumnLev">
	<option value="甲">甲</option>
	<option value="乙">乙</option>
	<option value="丙">丙</option>
	</select>
	批注:<input type="text" class="easyui-validatebox" name="uremark" id="uremark"/>
	<input type="hidden" class="easyui-validatebox" name="id" id="id"/>
	<a href="#" onclick="checkpassdown()" class="easyui-linkbutton">审核通过</a>
	<input type="hidden" id="userRole" value="${userrole}">
</div>
<div class="easyui-layout" fit="true">
	<div region="center" style="padding:0px;border:0px">
		<t:datagrid pageSize="100" name="getcheckList" onClick="selectMap" checkbox="false" pagination="true" fitColumns="false" title="选择审核数据" sortName="createDate" actionUrl="businessOrderController.do?checkListDatagrid" idField="id" fit="true" queryMode="group">
			<t:dgCol title="频道" frozenColumn="true"  field="sysOrgCode"  query="false"  queryMode="single"  width="60"></t:dgCol>
			<t:dgCol title="栏目" frozenColumn="true"  field="sysCompanyCode"  query="false"  queryMode="single"  width="60"></t:dgCol>
			<t:dgCol title="姓名" frozenColumn="true"  field="userName"  query="false"  queryMode="single"  width="60"></t:dgCol>
			<t:dgCol title="工作类别" frozenColumn="true" field="typeremark" queryMode="single" width="120"></t:dgCol>
			<t:dgCol title="身份证号" frozenColumn="true" field="userCard" query="false" queryMode="single" width="126"></t:dgCol>
			<t:dgCol title="录入金额" frozenColumn="true" field="cost" query="false" queryMode="group" width="70"></t:dgCol>
			<t:dgCol title="审核金额" frozenColumn="true" field="ucost" queryMode="single" width="70"></t:dgCol>
			<t:dgCol title="录入等级" frozenColumn="true" field="columnLev" queryMode="single" width="70"></t:dgCol>
			<t:dgCol title="审核等级" frozenColumn="true" field="ucolumnLev" queryMode="single" width="70"></t:dgCol>
			<t:dgCol title="汇款地址/账号" field="costAddr" queryMode="single" width="120"></t:dgCol>

			<t:dgCol title="发放方式" field="costPutout" queryMode="single" width="70"></t:dgCol>
			<t:dgCol title="稿件题目(内容)" field="contribution" queryMode="single" width="120"></t:dgCol>
			<t:dgCol title="播出时间" field="columnTime" queryMode="single" width="80"></t:dgCol>
			<t:dgCol title="字数/时长/版面" field="columnNum" queryMode="single" width="100"></t:dgCol>
			<t:dgCol title="费用类型" field="costType" query="false" queryMode="single" width="80"></t:dgCol>
			<t:dgCol title="制单人" field="createName" queryMode="single" width="60"></t:dgCol>

			<t:dgCol title="编辑" field="orderEdit" queryMode="single" width="60"></t:dgCol>
			<t:dgCol title="制片人" field="producer" queryMode="single" width="60"></t:dgCol>
			<t:dgCol title="部门主任" field="departManager" queryMode="single" width="60"></t:dgCol>
			<t:dgCol title="总监" field="producerManager" queryMode="single" width="120"></t:dgCol>
			<t:dgCol title="录入时间" field="createTime" query="true" queryMode="group" value1="${stdt}" value2="${eddt}"   formatter="yyyy-MM-dd" width="80"></t:dgCol>
			<t:dgCol title="审核记录" field="uLog" queryMode="single" width="450"></t:dgCol>
			<t:dgCol title="备注" field="comments" queryMode="single" width="120"></t:dgCol>

			<t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
		</t:datagrid>
	</div>
	<t:dictSelect field="demos[0].status" typeGroupCode="sf_yn" title="审核超时时间"></t:dictSelect>
</div>
<script type="text/javascript">
	function clearD() {
		$('#ucost').val("");
	}
	function selectMap(row,data){
		if("checkm"==$("#userRole").val()){
			$('#ucost').val(data.ucost);
			$('#id').val(data.id);
			document.getElementById('ucolumnLev').value=data.ucolumnLev;
		}else{
			$('#ucost').val(data.cost);
			$('#id').val(data.id);
			document.getElementById('ucolumnLev').value=data.columnLev;
		}

	}
	function checkpassdown()
	{
		if($('#ucost').val()==''||document.getElementById('ucolumnLev').value==''||$('#id').val()=='')
		{
			$.messager.alert('信息框','金额和等级不能为空，或数据有问题','warning');
			return;
		}
		if($('#getcheckList').datagrid("getRows").length<1)
		{
			$.messager.alert('信息框','请选择审核记录','warning');
			return;
		}
		if($('#getcheckList').datagrid("getSelections").length<1)
		{
			$.messager.alert('信息框','请选择审核记录','warning');
			return;
		}
		$.messager.confirm('审批', '您确定审批通过此条记录？', function(r){
			if (r){
				$.ajax({
					url:"businessOrderController.do?doCheck",
					type:"POST",
					dataType:"JSON",
					data:"ucost="+$("#ucost").val()+"&ucolumnLev="+$("#ucolumnLev").val()+"&remark="+$("#uremark").val()+"&id="+$("#id").val(),
					async: false,
					success:function(data){
						if(data.success){
							$.messager.alert('信息框','审核成功','warning');
							$('#ucost').val("");
							$('#id').val("");
							document.getElementById('ucolumnLev').value="";
							getcheckListsearch();
						}else{
							$.messager.alert('信息框',data.message,'warning');
							return;
						}
					}
				});

			}
		});
	}
</script>